#include<bits/stdc++.h>
using namespace std;
int index;
int maxlen;
void simplesearch(string s) {
	string a; 
	for (int i = 0; i < s.length(); i++) {
		for (int j = i + 1; j < s.length(); j++) {
			if (s[i] == s[j]) {
				int length = 1;
				for (int k = 1; s[i + k] == s[j + k]; k++) {
					length++;
				}
				if (length > maxlen) {
					maxlen = length;
					index = i;
				}
			}
		}
	}
}
int main() {
	string s = "bananananannana";
	simplesearch(s);
	cout << index << " " << maxlen;
	return 0;
}
